<?php
namespace backend\models;

use Yii;
use yii\base\Model;

class FilesForm extends Model{
	public $fiels;
	public $num = 5;

	public function scenarios(){
	    return [
	        'upload' => ['files'],
	    ];
	}

	public function rules(){
		return [
			['files', 'file', 'skipOnEmpty' => false, 'extensions' => 'png, jpg', 'maxFiles' => $this->getNum()],
		];
	}

	public function setNum($params){
		$this->num = $params;
	}

	public function getNum(){
		return $this->num;
	}
}